# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=perl-net-tftp
_pkgname=Crypt-Curve25519
pkgver=0.06
pkgrel=4
pkgdesc='Generate shared secret using elliptic-curve Diffie-Hellman function.'
url='https://metacpan.org/pod/Crypt::Curve25519'
arch=('x86_64' 'aarch64')
license=('PerlArtistic')
options=('!emptydirs')
source=("https://cpan.metacpan.org/authors/id/A/AJ/AJGB/$_pkgname-$pkgver.tar.gz")
sha512sums=('e5d351c36c9f60e1b55f45bf9fa871fddf949bd5c0a20b4d065e1eb2d4e24ba43807289591eda854fca28b5909fd6af1b0fc9ede63efbeeaf6e011e7382a4e1d')

prepare() {
  cd "$_pkgname-$pkgver"

  export PERL_MM_USE_DEFAULT=1 PERL5LIB="" \
    PERL_AUTOINSTALL=--skipdeps \
    PERL_MM_OPT="INSTALLDIRS=vendor DESTDIR='$pkgdir'" \
    PERL_MB_OPT="--installdirs vendor --destdir '$pkgdir'" \
    MODULEBUILDRC=/dev/null

  /usr/bin/perl Makefile.PL
}

build() {
  cd "$_pkgname-$pkgver"

  make
}

package() {
  cd "$_pkgname-$pkgver"

  make install

  find "$pkgdir" -name .packlist -o -name perllocal.pod -delete
}

